package com.bluemoon.model.test.dbImort.report;

import cn.com.bluemoon.daps.common.enums.DatabaseType;
import com.bluemoon.model.test.dbImort.file.DbResourceFile;
import com.bluemoon.model.test.dbImort.file.HiveExcelResourceFile;
import com.bluemoon.model.test.dbImort.file.MysqlExcelResourceFile;
import com.bluemoon.model.test.dbImort.file.PgsqlExcelResourceFile;

/**
 *
 * @author Jarod.Kong
 * @date 2021/2/4 17:03 
 */
public enum  ResultReportFactory {
    ;

    public static <T> IResultReportHandler<T> resultReportHandler(DatabaseType dbType) {
        IResultReportHandler<T> handler;
        if (dbType.equals(DatabaseType.HIVE)) {
            handler = new HiveResultReportHandler<>();
        } else if (DatabaseType.PGSQL.equals(dbType)) {
            handler = new PgsqlResultReportHandler<>();
        } else {
            handler = new MysqlResultReportHandler<>();
        }
        return handler;
    }
}
